/*
 * @Description:
 * @Autor: lcz
 * @Date: 2022-07-18 14:06:39
 * @LastEditors: lcz
 * @LastEditTime: 2022-07-18 14:24:54
 */
import { Divider } from 'antd'
import { CSSProperties, FC, ReactNode } from 'react'

export type orientationEnum = 'left' | 'right' | 'center'

export type typeEnum = 'horizontal' | 'vertical'

export interface baseProps {
  class?: string
  style?: CSSProperties | undefined
  tabIndex?: number
}
/*
  plain:文字是否显示为普通正文样式
*/
export interface dividerProps extends baseProps {
  dashed?: boolean
  children?: ReactNode
  plain?: boolean
  orientation?: orientationEnum | 'center'
  orientationMargin?: number 
  type?: typeEnum | 'horizontal'
}

const DividerComponent: FC<dividerProps> = props => {
  const { dashed, children, plain, orientationMargin, orientation, type } = props
  return (
    <div data-index={props.tabIndex}>
      <Divider
        className={props.class}
        style={props.style}
        dashed={dashed}
        plain={plain}
        orientation={orientation}
        orientationMargin={orientationMargin}
        type={type}
      >
        {children}
      </Divider>
    </div>
  )
}
export default DividerComponent
